Add gas-sponsored fund Earn Account examples (Python & TypeScript)#89
Merged
ElisabethDuijnstee merged 1 commit intomainfrom Jan 8, 2026
Merged
Add gas-sponsored fund Earn Account examples (Python & TypeScript)#89ElisabethDuijnstee merged 1 commit intomainfrom
ElisabethDuijnstee merged 1 commit intomainfrom
Conversation
Add working examples demonstrating how to fund an Earn Account with gas sponsorship, where users sign off-chain and a sponsor pays the gas fees. **Python Example:** - Uses compass_api_sdk with web3.py for signing - Demonstrates EIP-712 off-chain signing with eth_account - Successfully tested with 0.1 USDC transfer on Base **TypeScript Example:** - Uses @compass-labs/api-sdk with viem for wallet management - Uses @metamask/eth-sig-util for EIP-712 signing (handles TypeScript SDK camelCase type keys) - Normalizes EIP712Domain casing to match standard - Successfully tested with 0.1 USDC transfer on Base **Key Implementation Details:** - Step 1 (approve_transfer): One-time Permit2 approval per token - Step 2 (earn_transfer): Gas-sponsored deposit to Earn Account - Owner signs off-chain (no gas cost) - Sender broadcasts transaction and pays gas - Requires spender parameter when using gas sponsorship for deposits Both examples include: - Environment configuration with .env.example - Clear step-by-step comments with SNIPPET markers - Error handling and transaction confirmation - BaseScan links for transaction verification 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
ElisabethDuijnstee
approved these changes
Jan 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add working examples demonstrating how to fund an Earn Account with gas sponsorship, where users sign off-chain and a sponsor pays the gas fees.
Python Example:
TypeScript Example:
Key Implementation Details:
Both examples include:
🤖 Generated with Claude Code